package pos.utils;

import java.util.StringTokenizer;
import java.util.Vector;

public class Cadenas {
	public static Vector<String> separaElementos(String str, String delim) {
		Vector<String> v = new Vector<String>();
		StringTokenizer st = new StringTokenizer(str, delim);
		
		while(st.hasMoreTokens()) {
			v.add(st.nextToken());
		}
		
		return v;
	}
	
	public static Vector<String> separaElementosDelimitadores(String str, String delim) {
		Vector<String> v = new Vector<String>();
		StringTokenizer st = new StringTokenizer(str, delim, true);
		
		while(st.hasMoreTokens()) {
			v.add(st.nextToken());
		}
        
        return v;
    }
}
